package com.example.enums;

@lombok.Getter
@lombok.AllArgsConstructor
public enum BizCodeEnum {

    SUCCESS(200, "成功"),
    IDEMPOTENT_OPERATION(205, "幂等操作"),
    FREQUENT_OPERATION(207, "频繁操作"),
    PARAM_VERIFY_FAILED(400, "请求参数出错"),
    PERMISSION_VERIFICATION_FAILED(401, "权限验证失败"),
    NO_ACCESS(403, "禁止访问"),
    REQUEST_METHOD_NOT_SUPPORTED(404, "未知请求"),
    REQUEST_TIMEOUT(408, "请求超时"),
    INTERNAL_SYSTEM_ERROR(500, "服务器未知错误"),
    STATUS_TIMING_ERROR(505, "状态时序错误"),

    WP_LOGIN_FAILED(2001, "小程序登陆失败"),
    // 获取微信平台的AccessToken失败
    WECHAT_GET_ACCESS_TOKEN_FAILED(2002, "获取ACCESS_TOKEN失败"),
    // 获取微信平台的 ticket 失败
    WECHAT_GET_TICKET_FAILED(2003, "操作失败，请稍后重试..."),

    WECHAT_GET_OA_OAUTH_FAILED(2004, "操作失败，请稍后重试..."),

    WECHAT_GET_MP_OAUTH_FAILED(2005, "操作失败，请稍后重试..."),

    WECHAT_GET_MP_PHONE_FAILED(2006, "操作失败，请稍后重试..."),

    WECHAT_GET_MP_PHONE_PARAM_ERROR(2007, "参数错误"),

    DB_MP_OPENID_ERROR(2008, "数据库中小程序的opendId错误"),

    REDIS_MP_OPENID_ERROR(2009, "REDIS中小程序的opendId错误"),

    OUTSIDE_INVOKE_FAILED(2020, "操作失败"),

    CAR_TRAVEL_STATUS_ERROR(2030, "车辆的行使记录为完成状态不允许删除"),

    CAR_TRAVEL_DELETE_ERROR(2031, "有相关记录不允许删除"),
    CAR_TRAVEL_TO_ADDRESS_ERROR(2031, "到达地点异常"),
    CAR_TRAVEL_GO_TIME_ERROR(2032, "出发时间异常"),
    CAR_TRAVEL_BACK_TIME_ERROR(2033, "到达时间异常"),
    CAR_TRAVEL_DRIVER_ERROR(2034, "驾驶员信息异常"),

    CAR_STATUS_ERROR(2041, "车辆状态错误"),

    OPERATE_FAILED(9008, "操作失败"),
    USER_NOT_FIND(9009, "用户信息异常"),
    USER_TYPE_ERROR(9010, "用户类型异常"),

    FILE_UPLOAD_FAILED(600, "文件上传失败"),
    ACCOUNT_UNLOGIN(503, "未登录"),
    ;

    /**
     * 返回码
     */
    private int code;

    /**
     * 返回消息
     */
    private String msg;
}